<template>
  <div class="userInfo">
    <div class="wpr">
      <h5>个人基本信息</h5>
      <div class="ftable stable">
        <table>
          <tr><td>姓名:</td><td>{{ userI.name }}</td></tr>
          <tr><td>身份证号:</td><td>{{ userI.cardNumber }}</td></tr>
          <tr><td>银行卡号:</td><td>{{ userI.bankCardNo }}</td></tr>
          <tr><td>性别:</td><td>{{ userI.sex==1?"男":'女' }}</td></tr>
          <tr><td>公司:</td><td>{{ userI.company }}</td></tr>
          <tr><td>公司地址:</td><td>{{ userI.companyAddress }}</td></tr>
          <tr><td>职位:</td><td>{{ userI.job }}</td></tr>
          <tr><td>收入:</td><td>{{ incomeArr[userI.income || 0] }}</td></tr>
          <tr><td>联系邮箱:</td><td>{{ userI.email }}</td></tr>
          <tr><td>紧急联系人:</td><td>{{ userI.linkman }}</td></tr>
          <tr><td>紧急联系人电话:</td><td>{{ userI.linkmanMobile }}</td></tr>
<!--
          <tr><td>姓名:</td><td>{{ userI.name }}</td></tr>
          <tr><td>姓名:</td><td>{{ userI.name }}</td></tr>
          <tr><td>姓名:</td><td>{{ userI.name }}</td></tr>
          <tr><td>姓名:</td><td>{{ userI.name }}</td></tr>
          <tr><td>姓名:</td><td>{{ userI.name }}</td></tr>
          <tr><td>姓名:</td><td>{{ userI.name }}</td></tr> -->
          <!-- <tr>
            <td>共计天数</td><td>{{ userI.timeOffset }}</td>
          </tr>
          <tr>
            <td>月租金</td><td>{{ userI.cash*0.01 }}元</td>
          </tr> -->
        </table>
      </div>
    </div>
  </div>
</template>

<script>
  export default{
    data(){
      return{
        userId:'',
        userI:{},
        incomeArr:[
          '4K以下','4K-6K','6K-8K','8K-10K','10K-15K','15K以上',''
        ]
      }
    },
    beforeCreate(){
      this.$store.commit('starLoading');
      this.setTit('确认合同信息')
    },
    created(){
      console.log(this.$route.query.session);
      let session = this.$route.query.session,
          b = eval('(' + session + ')');
          if(!!b == false){
            this.userId == !!b;
            return;
          }
          this.userId = b.userId;
          if(!!b){
            this.$store.commit('revise',b)
          }else{
            this.$router.push({name:'404'})
          }
    },
    async beforeMount() {
      if(!this.userId){
        this.$store.commit('closeLoading');
        this.$router.push({name:'noAgree'});
        return;
      }
      this.userI = await this.$store.dispatch('getUserMsg',{userId:this.$store.state.User.info.userId});
      this.$store.commit('closeLoading');
    }
  }
</script>

<style lang="scss">
.userInfo{
  .wpr{padding:0 .4rem;}
  h4{
    text-align: center;font-size: .28rem;margin-bottom: .4rem;color:#333;
    i{font-size: 1.26rem;color:#ec5f51;margin:.56rem 0 .12rem; }
  }
  h5{color:#999;font-size: .28rem;text-indent: .2rem;line-height: .64rem;background-color: #f2f2f2;font-weight: bold;margin:.35rem 0;}
  .stable{padding:0 .54rem;text-align: center;}
  table{
    width:100%;
    td,th{padding:.25rem 0;font-size: .24rem;color:#999;}
    th{font-size: .3rem;color:#333;}
  }
  .ftable tr td:nth-child(1),.stable tr td:nth-child(1),.stable tr th:nth-child(1){text-align: left;}
  .ftable tr td:nth-last-child(1),.stable tr td:nth-last-child(1),.stable tr th:nth-last-child(1){text-align: left;}

}
</style>
